import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/get_statistice_score_entity.dart';

GetStatisticeScoreEntity $GetStatisticeScoreEntityFromJson(Map<String, dynamic> json) {
  final GetStatisticeScoreEntity getStatisticeScoreEntity = GetStatisticeScoreEntity();
  final int? createTime = jsonConvert.convert<int>(json['createTime']);
  if (createTime != null) {
    getStatisticeScoreEntity.createTime = createTime;
  }
  final int? updateTime = jsonConvert.convert<int>(json['updateTime']);
  if (updateTime != null) {
    getStatisticeScoreEntity.updateTime = updateTime;
  }
  final String? creator = jsonConvert.convert<String>(json['creator']);
  if (creator != null) {
    getStatisticeScoreEntity.creator = creator;
  }
  final String? updater = jsonConvert.convert<String>(json['updater']);
  if (updater != null) {
    getStatisticeScoreEntity.updater = updater;
  }
  final bool? deleted = jsonConvert.convert<bool>(json['deleted']);
  if (deleted != null) {
    getStatisticeScoreEntity.deleted = deleted;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    getStatisticeScoreEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    getStatisticeScoreEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    getStatisticeScoreEntity.companyName = companyName;
  }
  final String? statisticsTime = jsonConvert.convert<String>(json['statisticsTime']);
  if (statisticsTime != null) {
    getStatisticeScoreEntity.statisticsTime = statisticsTime;
  }
  final double? noAlarmScore = jsonConvert.convert<double>(json['noAlarmScore']);
  if (noAlarmScore != null) {
    getStatisticeScoreEntity.noAlarmScore = noAlarmScore;
  }
  final double? dealScore = jsonConvert.convert<double>(json['dealScore']);
  if (dealScore != null) {
    getStatisticeScoreEntity.dealScore = dealScore;
  }
  final double? timingScore = jsonConvert.convert<double>(json['timingScore']);
  if (timingScore != null) {
    getStatisticeScoreEntity.timingScore = timingScore;
  }
  final double? overallScore = jsonConvert.convert<double>(json['overallScore']);
  if (overallScore != null) {
    getStatisticeScoreEntity.overallScore = overallScore;
  }
  return getStatisticeScoreEntity;
}

Map<String, dynamic> $GetStatisticeScoreEntityToJson(GetStatisticeScoreEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['creator'] = entity.creator;
  data['updater'] = entity.updater;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['statisticsTime'] = entity.statisticsTime;
  data['noAlarmScore'] = entity.noAlarmScore;
  data['dealScore'] = entity.dealScore;
  data['timingScore'] = entity.timingScore;
  data['overallScore'] = entity.overallScore;
  return data;
}

extension GetStatisticeScoreEntityExtension on GetStatisticeScoreEntity {
  GetStatisticeScoreEntity copyWith({
    int? createTime,
    int? updateTime,
    String? creator,
    String? updater,
    bool? deleted,
    int? id,
    int? companyId,
    String? companyName,
    String? statisticsTime,
    double? noAlarmScore,
    double? dealScore,
    double? timingScore,
    double? overallScore,
  }) {
    return GetStatisticeScoreEntity()
      ..createTime = createTime ?? this.createTime
      ..updateTime = updateTime ?? this.updateTime
      ..creator = creator ?? this.creator
      ..updater = updater ?? this.updater
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..statisticsTime = statisticsTime ?? this.statisticsTime
      ..noAlarmScore = noAlarmScore ?? this.noAlarmScore
      ..dealScore = dealScore ?? this.dealScore
      ..timingScore = timingScore ?? this.timingScore
      ..overallScore = overallScore ?? this.overallScore;
  }
}